home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / game / patch / WHDIGamesH-M.lzh / games / IK+.lha / IK+ Install / Install < prev    next >
Text File  |  1998-12-05  |  4KB  |  173 lines

  1. ;****************************
  2.  
  3. (set #readme-file "README")    ;name of readme file
  4. (set #cleanup "")        ;files to delete after install
  5. (set #last-file "IK+.Image")    ;last file the imager should create
  6.  
  7. ;****************************
  8. ;----------------------------
  9. ; Checks if given program is reachable via the path
  10. ; if not abort install
  11. ; IN:  #program - to check
  12. ; OUT: -
  13.  
  14. (procedure P_chkrun
  15.   (if
  16.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  17.     ("")
  18.     (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the whdload package." #program))
  19.   )
  20. )
  21.  
  22. ;****************************
  23.  
  24. (if
  25.   (exists #readme-file)
  26.   (if 
  27.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  28.     ("")
  29.     (run ("SYS:Utilities/More %s" #readme-file))
  30.   )
  31. )
  32.  
  33. (set #program "WHDLoad")
  34. (P_chkrun)
  35.  
  36. (set #program "Patcher")
  37. (P_chkrun)
  38.  
  39. (set @default-dest
  40.   (askdir
  41.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  42.     (help @askdir-help)
  43.     (default @default-dest)
  44.     (disk)
  45.   )
  46. )
  47. (set #dest (tackon @default-dest @app-name))
  48. (if
  49.   (exists #dest)
  50.   (
  51.     (set #choice
  52.       (askbool
  53.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
  54.         (default 1)
  55.         (choices "Delete" "Skip")
  56.         (help @askbool-help)
  57.       )
  58.     )
  59.     (if
  60.       (= #choice 1)
  61.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  62.     )
  63.   )
  64. )
  65. (makedir #dest
  66.   (help @makedir-help)
  67.   (infos)
  68. )
  69.  
  70. ;----------------------------
  71.  
  72. (if
  73.   (exists ("%s.newicon" @app-name))
  74.   (set #icon
  75.     (askchoice
  76.       (prompt "\nWhich icon do you like to install ?\n")
  77.       (default 0)
  78.       (choices "Normal" "NewIcon")
  79.       (help @askchoice-help)
  80.     )
  81.   )
  82.   (set #icon 0)
  83. )
  84. (select #icon
  85.   (set #icon ("%s.inf" @app-name))
  86.   (set #icon ("%s.newicon" @app-name))
  87. )
  88. (copyfiles
  89.   (help @copyfiles-help)
  90.   (source #icon)
  91.   (newname ("%s.info" @app-name))
  92.   (dest #dest)
  93. )
  94. (copyfiles
  95.   (help @copyfiles-help)
  96.   (source ("%s.slave" @app-name ))
  97.   (dest #dest)
  98. )
  99. (if
  100.   (exists #readme-file)
  101.   (copyfiles
  102.     (help @copyfiles-help)
  103.     (source #readme-file)
  104.     (dest #dest)
  105.   )
  106. )
  107. (if
  108.   (exists ("%s.info" #readme-file))
  109.   (copyfiles
  110.     (help @copyfiles-help)
  111.     (source ("%s.info" #readme-file))
  112.     (dest #dest)
  113.   )
  114. )
  115.  
  116. (set #ver
  117.   (askchoice
  118.     (prompt "\nWhich version of IK+ do you own ?")
  119.     (default 0)
  120.     (choices "Normal Floppy Disk" "CDTV Version")
  121.     (help @askchoice-help)
  122.   )
  123. )
  124.  
  125. (select #ver
  126.   (
  127.     (if
  128.       (= @user-level 2)
  129.       (
  130.         (set #CI_drive
  131.           (askchoice
  132.         (prompt "Select source drive for diskimages")
  133.         (default 0)
  134.         (choices "DF0:" "DF1:" "DF2:" "DF3:")
  135.         (help @askchoice-help)
  136.           )
  137.         )
  138.         (select #CI_drive
  139.           (set #CI_drive "DF0:")
  140.           (set #CI_drive "DF1:")
  141.           (set #CI_drive "DF2:")
  142.           (set #CI_drive "DF3:")
  143.         )
  144.       )
  145.       (set #CI_drive "DF0:")
  146.     )
  147.     (run ("Assign \"%s:\" \"%s\"" @app-name #dest))
  148.     (run ("Patcher -p%s.imager -s%s" @app-name #CI_drive))
  149.     (run ("Assign \"%s:\" Remove" @app-name))
  150.     (if
  151.       (exists (tackon #dest #last-file))
  152.       ("")
  153.       (abort "Diskimaging not successful !\nThe Patcher was unable to create all needed files !")
  154.     )
  155.   )
  156.   (
  157.     (message "Please insert your IK+ CD.")
  158.     (copyfiles
  159.       (help @copyfiles-help)
  160.       (source "cdtv_test:IK+")
  161.       (dest #dest)
  162.       (newname "IK+.Image")
  163.     )
  164.   )
  165. )
  166.  
  167. ;----------------------------
  168.  
  169. (run ("Delete %s ALL QUIET FORCE" #cleanup))    ;delete temporary files
  170.  
  171. (exit)
  172.  
  173.